package com.bjpowernode.query;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 接收活动查询参数
 */
@Data
public class ActivityQuery {
    private Integer ownerId;

    @NotEmpty(message = "活动名称不能为空")
    @Size(min = 3, max = 30, message = "活动名称长度必须在3到30之间")
    private String activityName;

    @NotEmpty(message = "活动开始时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @NotEmpty(message = "活动结束时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @NotEmpty(message = "活动预算不能为空")
    @Pattern(regexp = "^[0-9]+$", message = "活动预算必须是数字")
    private BigDecimal cost;

    @NotEmpty(message = "创建时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
}
